package domainObjects;

import java.util.ArrayList;

//create by martin souliere
public class Dossier {

	protected long _id;
	protected String _nom;
	protected String _noPermis;
	protected String _noPlaque;
	protected String _prenom;
	protected ArrayList<Infraction> _infractions;
	
	public Dossier(long id,String nom, String prenom,String noPermis, String noPlaque) {
		_id = id;
		_nom = nom;
		_noPermis = noPermis;
		_noPlaque = noPlaque;
		_prenom = prenom;
		_infractions = new ArrayList<Infraction>();
	}
	public long id() {
		return _id;
	}

	public String nom() {
		return _nom;
	}

	public String noPermis() {
		return _noPermis;
	}

	public String noPlaque() {
		return _noPlaque;
	}

	public String prenom() {
		return _prenom;
	}

	public int niveau() {
		int max = 0;
		for (Infraction infraction : _infractions) {
			if(infraction.niveau() > max)
				max = infraction.niveau();
		}
		return max;
	}

	public ArrayList<Infraction> getListeInfraction() {		
		return _infractions;
	}
	
	public void setListInfraction(ArrayList<Infraction> infractions) {		
		_infractions =infractions;
	}
	
	public void ajouterInfractionAListe(Infraction infraction) {
		_infractions.add(infraction);
	}

	public String _toString() {		
		return _noPermis + " " + _prenom + " " + _nom + " " + _noPlaque;
	}

}
